local feixiangzhijian__halberd_skill = fk.CreateSkill {

  name = "#feixiangzhijian__halberd_skill",

  tags = {  },

}



feixiangzhijian__halberd_skill:addEffect("targetmod", {
  name = "#feixiangzhijian__halberd_skill",
  attached_equip = "feixiangzhijian__halberd",
  extra_target_func = function(self, player, skill, card)
    if player:hasSkill(feixiangzhijian__halberd_skill.name) and skill.trueName == "slash_skill" then
      local cards = card:isVirtual() and card.subcards or { card.id }
      local handcards = player:getCardIds(Player.Hand)
      if #handcards > 0 and #cards == #handcards and table.every(cards, function(id)
            return table.contains(
              handcards, id)
          end) then
        return 2
      end
    end
  end,
})

feixiangzhijian__halberd_skill:addEffect(fk.CardUsing, {
  refresh_events = { fk.CardUsing },
  can_refresh = function(self, event, target, player, data)
    return target == player and player:hasSkill(feixiangzhijian__halberd_skill.name) and
        data.card.trueName == "slash" and #data.tos > 1
  end,
  on_refresh = function(self, event, target, player, data)
    local room = player.room
    room:broadcastPlaySound(Thbattle_path .. "audio/card/male/feixiangzhijian__halberd")
  end,
})

return feixiangzhijian__halberd_skill